import Vue from 'vue';

function camelToUnderline(str) {
    let result = str.replace(/([A-Z])/g, "-$1").toLowerCase();
    return result.substring(1);
}

function lowerName(cmpname) {
    let dic = camelToUnderline(cmpname);
    
    return dic.toLowerCase();
}

const Coms = [{
        name: lowerName("DicAvatar"),
        component: () =>
            import ('./DicAvatar.vue')
    },
    {
        name: lowerName("DicBacktop"),
        component: () =>
            import ('./DicBacktop.vue')
    },
    {
        name: lowerName("DicBadge"),
        component: () =>
            import ('./DicBadge.vue')
    },
    {
        name: lowerName("DicBreadcrumb"),
        component: () =>
            import ('./DicBreadcrumb.vue')
    },
    {
        name: lowerName("DicButton"),
        component: () =>
            import ('./DicButton.vue')
    },
    {
        name: lowerName("DicCalendar"),
        component: () =>

            import ('./DicCalendar.vue')
    },
    {
        name: lowerName("DicCard"),
        component: () =>
            import ('./DicCard.vue')
    },
    {
        name: lowerName("DicCarousel"),
        component: () =>
            import ('./DicCarousel.vue')
    },
    {
        name: lowerName("DicCascader"),
        component: () =>
            import ('./DicCascader.vue')
    },
    {
        name: lowerName("DicCheckbox"),
        component: () =>
            import ('./DicCheckbox.vue')
    },
    {
        name: lowerName("DicCollapse"),
        component: () =>
            import ('./DicCollapse.vue')
    },
    {
        name: lowerName("DicColorPicker"),
        component: () =>
            import ('./DicColorPicker.vue')
    },
    {
        name: lowerName("DicDatePicker"),
        component: () =>
            import ('./DicDatePicker.vue')
    },
    {
        name: lowerName("DicDateTimePicker"),
        component: () =>
            import ('./DicDateTimePicker.vue')
    },
    {
        name: lowerName("DicDialog"),
        component: () =>
            import ('./DicDialog.vue')
    },
    {
        name: lowerName("DicDivider"),
        component: () =>
            import ('./DicDivider.vue')
    },
    {
        name: lowerName("DicDrawer"),
        component: () =>
            import ('./DicDrawer.vue')
    },
    {
        name: lowerName("DicDropdown"),
        component: () =>
            import ('./DicDropdown.vue')
    },
    {
        name: lowerName("DicForm"),
        component: () =>
            import ('./DicForm.vue')
    },
    {
        name: lowerName("DicImage"),
        component: () =>
            import ('./DicImage.vue')
    },
    {
        name: lowerName("DicInfiniteScroll"),
        component: () =>
            import ('./DicInfiniteScroll.vue')
    },
    {
        name: lowerName("DicInput"),
        component: () =>
            import ('./DicInput.vue')
    },
    {
        name: lowerName("DicInputNumber"),
        component: () =>
            import ('./DicInputNumber.vue')
    },
    {
        name: lowerName("DicLink"),
        component: () =>
            import ('./DicLink.vue')
    },
    {
        name: lowerName("DicLoading"),
        component: () =>
            import ('./DicLoading.vue')
    },
    {
        name: lowerName("DicMessage"),
        component: () =>
            import ('./DicMessage.vue')
    },
    {
        name: lowerName("DicMessageBox"),
        component: () =>
            import ('./DicMessageBox.vue')
    },
    {
        name: lowerName("DicNavMenu"),
        component: () =>
            import ('./DicNavMenu.vue')
    },
    {
        name: lowerName("DicNotification"),
        component: () =>
            import ('./DicNotification.vue')
    },
    {
        name: lowerName("DicPageHeader"),
        component: () =>
            import ('./DicPageHeader.vue')
    },
    {
        name: lowerName("DicPagination"),
        component: () =>
            import ('./DicPagination.vue')
    },
    {
        name: lowerName("DicPopconfirm"),
        component: () =>
            import ('./DicPopconfirm.vue')
    },
    {
        name: lowerName("DicPopover"),
        component: () =>
            import ('./DicPopover.vue')
    },
    {
        name: lowerName("DicProgress"),
        component: () =>
            import ('./DicProgress.vue')
    },
    {
        name: lowerName("DicRadio"),
        component: () =>
            import ('./DicRadio.vue')
    },
    {
        name: lowerName("DicRate"),
        component: () =>
            import ('./DicRate.vue')
    },
    {
        name: lowerName("DicSelect"),
        component: () =>
            import ('./DicSelect.vue')
    },
    {
        name: lowerName("DicSlider"),
        component: () =>
            import ('./DicSlider.vue')
    },
    {
        name: lowerName("DicSteps"),
        component: () =>
            import ('./DicSteps.vue')
    },
    {
        name: lowerName("DicSwitch"),
        component: () =>
            import ('./DicSwitch.vue')

    },
    {
        name: lowerName("DicTable"),
        component: () =>
            import ('./DicTable.vue')

    },
    {
        name: lowerName("DicTabs"),
        component: () =>
            import ('./DicTabs.vue')
    },
    {
        name: lowerName("DicTag"),
        component: () =>
            import ('./DicTag.vue')
    },
    {
        name: lowerName("DicTimeline"),
        component: () =>
            import ('./DicTimeline.vue')
    },
    {
        name: lowerName("DicTimePicker"),
        component: () =>
            import ('./DicTimePicker.vue')
    },
    {
        name: lowerName("DicTooltip"),
        component: () =>
            import ('./DicTooltip.vue')
    },
    {
        name: lowerName("DicTransfer"),
        component: () =>
            import ('./DicTransfer.vue')
    },
    {
        name: lowerName("DicTree"),
        component: () =>
            import ('./DicTree.vue')
    },
    {
        name: lowerName("DicUpload"),
        component: () =>
            import ('./DicUpload.vue')
    },
    {
        name: lowerName("DicRow"),
        component: () =>
            import ('./DicRow.vue')
    },
    {
        name: lowerName("DicRadioButton"),
        component: () =>
            import ('./DicRadioButton.vue')
    },
    {
        name: lowerName("DicFormItem"),
        component: () =>
            import ('./DicFormItem.vue')
    },
    {
        name: lowerName("DicCol"),
        component: () =>
            import ('./DicCol.vue')
    },
    {
        name: lowerName("DicRadioGroup"),
        component: () =>
            import ('./DicRadioGroup.vue')
    },
    {
        name: lowerName("DicOption"),
        component: () =>
            import ('./DicOption.vue')
    },
    {
        name: lowerName("DicCheckboxButton"),
        component: () =>
            import ('./DicCheckboxButton.vue')
    },
    {
        name: lowerName("DicCheckboxGroup"),
        component: () =>
            import ('./DicCheckboxGroup.vue')
    },
    {
        name: lowerName("DicTabPane"),
        component: () =>
            import ('./DicTabPane.vue')
    },
];

const ppmui = () => {
    Coms.forEach(item => {
        return Vue.component(item.name, item.component)
    })
}

export default ppmui